package cn.iocoder.an.module.mold.controller.admin.equipmnetkeepwait.vo;

import cn.idev.excel.annotation.ExcelIgnoreUnannotated;
import cn.idev.excel.annotation.ExcelProperty;
import cn.iocoder.an.module.business.dal.dataobject.equipmentmanage.EquipmentManageDO;
import cn.iocoder.an.module.mold.controller.admin.keeptask.vo.KeepTaskRespVO;
import cn.iocoder.an.module.mold.dal.dataobject.equipmentkeepsettingtype.EquipmentKeepSettingTypeDO;
import com.fhs.core.trans.anno.Trans;
import com.fhs.core.trans.constant.TransType;
import com.fhs.core.trans.vo.VO;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;

@Schema(description = "管理后台 - 待维护设备 Response VO")
@Data
@ExcelIgnoreUnannotated
public class EquipmnetKeepWaitRespVO implements VO {

    @Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "27591")
    @ExcelProperty("id")
    private Long id;

    @Schema(description = "维护单号", requiredMode = Schema.RequiredMode.REQUIRED)
    @ExcelProperty("维护单号")
    private String keepNo;

    @Schema(description = "维护项id", requiredMode = Schema.RequiredMode.REQUIRED, example = "20811")
    @ExcelProperty("维护项id")
    @Trans(type = TransType.SIMPLE, target = EquipmentKeepSettingTypeDO.class,   fields = {"name","cycle"},refs = {"itemName","cycle"})
    private Long itemId;

    @Schema(description = "维护项名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "xxx")
    private String itemName;

    @Schema(description = "维护周期", requiredMode = Schema.RequiredMode.REQUIRED, example = "180")
    private String cycle;

    @Schema(description = "设备id", requiredMode = Schema.RequiredMode.REQUIRED, example = "21186")
    @ExcelProperty("设备id")
    @Trans(type = TransType.SIMPLE, target = EquipmentManageDO.class,   fields = {"equipmentName","deptName","equipmentModel","code","installPosition"},refs = {"equipmentName","deptName","equipmentModel","equipmentCode","installPosition"})
    private Long equipmentId;

    @Schema(description = "设备名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "xxx")
    @ExcelProperty("设备名称")
    private String equipmentName;

    private String installPosition;

    @Schema(description = "规格型号", requiredMode = Schema.RequiredMode.REQUIRED, example = "xxx")
    @ExcelProperty("规格型号")
    private String equipmentModel;

    @Schema(description = "编码", requiredMode = Schema.RequiredMode.REQUIRED, example = "xxx")
    @ExcelProperty("编码")
    private String equipmentCode;



    @Schema(description = "所属部门", requiredMode = Schema.RequiredMode.REQUIRED, example = "xxx")
    @ExcelProperty("所属部门")
    private String deptName;

    @Schema(description = "维护状态", example = "2")
    @ExcelProperty("维护状态")
    private Integer status;

    @Schema(description = "计划维护日期")
    @ExcelProperty("计划维护日期")
    private LocalDate planDate;

    @Schema(description = "剩余天数", requiredMode = Schema.RequiredMode.REQUIRED)
    @ExcelProperty("剩余天数")
    private Integer remaining;

    @Schema(description = "责任人ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "23310")
    @ExcelProperty("责任人ID")
    private List<Long> dutyUserId;

    @Schema(description = "责任人名称", example = "张三")
    @ExcelProperty("责任人名称")
    private String dutyUserName;

    @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
    @ExcelProperty("创建时间")
    private LocalDateTime createTime;

    //派工时间
    private LocalDateTime sendTime;

    //关联的维护任务对象
    private KeepTaskRespVO taskRespVO;

    //是否是审核人或管理员
    private boolean reviewerPermission;

    //维护次数
    private Integer keepCount;

    //预警颜色
    private String color ;

}